package com.thti.mecool.client.command.result.user;

import android.os.Bundle;
import android.os.Message;

import com.thti.mecool.client.activity.UpdatePasswdActivity;
import com.thti.mecool.client.command.ICommand;
import com.thti.mecool.client.protocol.MessageInfo;
import com.thti.mecool.client.protocol.user.UserChangePasswordResult;
import com.thti.mecool.client.service.Protocol;

public class UpdateUserCommand implements ICommand {

	@Override
	public void doCommand(Object o) {
		UserChangePasswordResult result = (UserChangePasswordResult) o;

		MessageInfo messageInfo = result.getMsg();
		if (messageInfo != null) {
			Message msg = new Message();
			Bundle bundle = new Bundle();
			bundle.putSerializable("messageinfo", messageInfo);
			msg.setData(bundle);
			UpdatePasswdActivity.handler.sendMessage(msg);
			System.out.println( messageInfo.getContent());
		}
	}

	@Override
	public String getCommandID() {
		// TODO Auto-generated method stub
		return Protocol.getChangepassword;
	}

	@Override
	public Class<?> getCommandClass() {

		// TODO Auto-generated method stub
		return UserChangePasswordResult.class;
	}

}
